package com.bai.Mapper;

import com.bai.Pojo.Admin;
import com.bai.Pojo.SysPermission;
import com.bai.Pojo.SysRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminMapper {
    //登录
    Admin LoginByUser(@Param("username")String username, @Param("password")String password);
    //所有
    List<Admin> queryAllAdmin(@Param("offset") int offset,@Param("limit") int limit);

    List<Admin> queryAll();


    int queryAllAdminCount();

    //删--根据Id
    int deleteAdmin(Integer  id);

    //添加
    int addAdmin(Admin admin);

    int editAdmin(Admin admin);

    Admin getAdmin(@Param("id") int id);

    Admin findAdminByUsername(String username);

    List<SysRole> findRoles(@Param("username")String username);

    List<SysPermission> findPermissions(@Param("roleName") String roleName);
}
